﻿using SqlSugar;
using System.Collections.Generic;

namespace ManageSystem.Model
{
    // a map between entity and table
    [SugarTable("user_list")]
    public partial class User
    {
        // 主键
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int userID { get; set; }
        public string username { get; set; }
        public string password { get; set; }
        public string permissionString { get; set; }
        public string userRole { get; set; }

        public User() { }

        public User(string username, string password, string permissionString, string userRole)
        {
            this.username = username;
            this.password = password;
            this.permissionString = permissionString;
            this.userRole = userRole;
        }
    }



    public class PermissionUrlMap
    {
        // map
        public static Dictionary<string, string> permissionUrlMap = new Dictionary<string, string>
        {
            // system
            { "projectSystem", "/managesystem/User/ToProjectSystem"},
            { "incomeStreamSystem", "/managesystem/User/ToIncomeStreamSystem"},
            { "outlayStreamSystem", "/managesystem/User/ToOutlayStreamSystem"},
            // user
            { "updateMyUser", "/managesystem/User/UpdateMyUser"},
            { "queryAllProject", "/managesystem/Project/QueryAllProject"},
            { "addProject", "/managesystem/Project/AddProject"},
            { "deleteProject", "/managesystem/Project/DeleteProject"},
            { "updateProject", "/managesystem/Project/UpdateProject"},
            // project resource
            { "projectResource", "/managesystem/ProjectResource"},
            // incomestream
            { "queryAllIncomeStream", "/managesystem/IncomeStream/QueryAllIncomeStream"},
            { "addIncomeStream", "/managesystem/IncomeStream/AddIncomeStream"},
            { "deleteIncomeStream", "/managesystem/IncomeStream/DeleteIncomeStream"},
            { "updateIncomeStream", "/managesystem/IncomeStream/UpdateIncomeStream"},
            // outlaystream
            { "queryAllOutlayStream", "/managesystem/OutlayStream/QueryAllOutlayStream"},
            { "addOutlayStream", "/managesystem/OutlayStream/AddOutlayStream"},
            { "deleteOutlayStream", "/managesystem/OutlayStream/DeleteOutlayStream"},
            { "updateOutlayStream", "/managesystem/OutlayStream/UpdateOutlayStream"},
        };
    }
}
